<%@page import="beans.Project"%>
<%@page import="beans.Project.Task"%>
<%@page import="beans.Skill"%>

<jsp:useBean id="person" class="beans.Person" scope="session"/>
<jsp:useBean id="projects" type="java.util.List" scope="request"/>
<jsp:useBean id="skills" type="java.util.List" scope="request"/>

<html>
<body>
Welcome <%=person.email%>
<form method="post" action="servlet/UnprivilegedServlet">
Action:
<select name="action">
<option value="join">Join Task</option>
<option value="leave">Leave Task</option>
<option value="modify">Change Status</option>
</select>
<input type="submit" value="Perform"/>
</form>

<h4>Your Tasks</h4>
<table border="1">
<tr><th>Project</th><th>Task</th><th>Status</th></tr>
<%
for(int i = 0; i < projects.size(); i++) {
	Project p = (Project)projects.get(i);
	for(int j = 0; j < p.tasks.size(); j++) {
		Task t = (Task)p.tasks.get(j);
%>
	<tr><td><%=p.title%></td><td><%=t.description%></td><td><%=t.status%></td></tr>
<%
	}
}
%>
</table>

<h4>Your Skills</h4>
<table border="1">
<tr><th>Skill</th><th>Level</th><th>Goal</th></tr>
<%
for(int i = 0; i < skills.size(); i++) {
	Skill s = (Skill)skills.get(i);
%>
	<tr><td><%=s.description%></td><td><%=s.acquiredLevel%></td><td><%=s.neededLevel%></td></tr>
<%	
}
%>
</table>

</body>
</html>